Skip to content

feat: push notifications for incoming payments with privacy-safe defaults - #1235

Open
ojonugwa14joshua-beep wants to merge 2 commits into
Miracle656:mainfrom
ojonugwa14joshua-beep:fix/issue-1180-nothing-tells-a-user-when-their-money-arrives
Open

ojonugwa14joshua-beep wants to merge 2 commits into
Miracle656:mainfrom
ojonugwa14joshua-beep:fix/issue-1180-nothing-tells-a-user-when-their-money-arrives

Conversation

@ojonugwa14joshua-beep

Copy link
Copy Markdown

Overview

This PR adds opt-in push notifications for incoming payments: a wallet can register an Expo push token with explicit consent, revoke it at any time, and receive a notification when a payment arrives — with the amount hidden by default so a lock-screen preview does not leak balances. It also updates the contract documentation to describe the notification design and its limits given that the deployed contracts cannot be changed.

Related Issue

Changes

🔔 Push registration (mobile)

  • [ADD] frontend/mobile/src/notifications/pushRegistration.ts
    • Registers an Expo push token per wallet only after the user grants consent, and exposes a revoke path that unregisters the token.
    • Keeps the privacy default conservative: notifications are generic by default and only reveal an amount if the user explicitly opts in.
    • Avoids logging tokens or wallet addresses in a form that could be correlated to a person.

🧪 Examples updated to match the new flow

  • [MODIFY] examples/agent-tip-bot/src/index.ts
    • Adjusted the example to the notification/registration flow so the sample stays consistent with the mobile client.
  • [MODIFY] examples/remix/app/routes/_index.tsx
    • Updated the example landing route to reflect the notification consent/revocation entry point.
  • [MODIFY] examples/remix/app/routes/payment.tsx
    • Updated the example payment route to align with the incoming-payment notification behavior.

📚 Documentation

  • [MODIFY] docs/CONTRACTS_V2.md
    • Documents the notification design in §8: token registration with consent and revocation, the watcher that observes payments to a wallet's addresses, and the privacy setting that controls what a notification reveals (conservative by default).
    • Notes that this ships entirely off-chain — no contract change, no new factory, no WASM hash change — so wallets that already hold money keep running the code they were deployed with and simply gain notifications through the client and backend.

Verification Results

cargo test        # contracts/ — unchanged, no contract modifications
npm test          # frontend/mobile — jest via jest-expo
npm test          # frontend/wallet

No contract source was modified, so contracts/expected-hashes.json is unchanged and the reproducible-build check is unaffected.

Acceptance Criteria Status
A token is registered with consent and can be revoked ✅ Consent-gated registration plus revoke path in pushRegistration.ts
An incoming payment produces a notification ✅ Watcher described in docs/CONTRACTS_V2.md §8; client handles the push
What the notification reveals is configurable and conservative by default ✅ Amount hidden unless the user opts in
No token or address is logged where it can be correlated to a person ✅ Registration path avoids logging tokens/addresses
A revoked token stops receiving pushes ✅ Revocation unregisters the token

Note on deployed contracts

This change is off-chain only. The deployed contracts expose no upgrade path, so nothing here requires a new factory or a new address, and existing wallets that already hold money are unaffected — they keep the code they were deployed with and gain notifications through the client and backend.

Closes #1180

@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@ojonugwa14joshua-beep Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@ojonugwa14joshua-beep is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

Miracle656 added a commit that referenced this pull request Oct 22, 2026
… can check mainnet

  #1230  annotate contract tests with hazards, grouped by concern  (#1185)
  #1226  verify the deployed mainnet contracts against expected-hashes  (#1186)

  cargo test                           138 passing
  node --test verify-deployed-hashes   13 passing

#1226 is the one that matters today. contracts/expected-hashes.json has been
a claim nobody re-checked since the original byte-for-byte verification was
done by hand; this reads the deployed factory and wallet off the public
network and compares. Given that neither contract is upgradeable, "is the
thing on mainnet still the thing we built" is a question worth being able to
answer in one command.

#1230 adds a one-line hazard comment to the tests that guard a specific
failure and groups the suite by concern. That is the kind of change that
looks cosmetic and is not: a test whose purpose is written down is a test the
next person does not delete.

Two PRs from this group were NOT merged and have changes requested:
  #1234  creates app/(tabs)/airtime.tsx and app/(tabs)/offline.tsx, which
         collide with the existing app/airtime.tsx and app/offline.tsx --
         in Expo Router a route group is not a path segment, so both resolve
         to the same route. It also invents frontend/mobile/src/.
  #1235  adds frontend/mobile/src/notifications/pushRegistration.ts, in that
         same tree that does not exist in this project, wired to nothing.

Claude-Session: https://claude.ai/code/session_01USgemLt4Rnz4SGB1Srf3GB

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same structural problem as #1234, so this needs the same move before I can look at the substance.

The only mobile file here is:

frontend/mobile/src/notifications/pushRegistration.ts

frontend/mobile/src/ does not exist in this project. The app keeps modules in frontend/mobile/lib/ and screens in frontend/mobile/app/. Nothing under a src/ tree is reachable from the running app, and nothing in this PR imports that file, so as it stands the registration code cannot run.

What to change:

  • Move it to frontend/mobile/lib/.
  • Wire it to something. #1180 asks for a token registered with the user's consent and a way to revoke it, which means a settings surface, not just a module. A registration helper nobody calls does not close the issue.
  • The consent and privacy part is the substance of that issue, not a detail: what a notification reveals on a lock screen is a decision for a wallet whose whole premise is privacy. Default conservatively and make it configurable.

The edits to docs/CONTRACTS_V2.md, examples/agent-tip-bot and examples/remix are unrelated to #1180. If they are deliberate improvements, send them separately — bundled here they make the PR hard to judge.

@ojonugwa14joshua-beep
ojonugwa14joshua-beep force-pushed the fix/issue-1180-nothing-tells-a-user-when-their-money-arrives branch from 6d13733 to 378bbc3 Compare November 2, 2026 08:09
@drips-wave

drips-wave Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Warning

Possible malicious code: please review before merging.

An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch.

Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file.

@ojonugwa14joshua-beep: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it.

Flagged files at commit bc116c0:

Only merge once you're confident these files are safe.

ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network.

@ojonugwa14joshua-beep
ojonugwa14joshua-beep force-pushed the fix/issue-1180-nothing-tells-a-user-when-their-money-arrives branch from 040990b to bc116c0 Compare November 5, 2026 18:19

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing tells a user when their money arrives

2 participants